package com.example.sls.controller.user;

import com.example.sls.pojo.user.ExerciseData;
import com.example.sls.service.intserfaces.user.ExerciseDataService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 运动数据表(ExerciseData)表控制层
 *
 * @author 蓝江富
 * @since 2024-06-19 13:23:43
 */
@RestController
@RequestMapping("user/exerciseData")
public class ExerciseDataController {
  @Autowired
  ExerciseDataService exerciseDataService;

  @GetMapping("queryById")
  ExerciseData queryById(Integer id) {
    return exerciseDataService.queryById(id);
  }

  @GetMapping("queryAllByLimit")
  List<ExerciseData> queryAllByLimit(ExerciseData exerciseData, Integer pageSize, Integer offset) {
    return exerciseDataService.queryAllByLimit(exerciseData, pageSize, offset);
  }

  @GetMapping("count")
  long count() {
    return exerciseDataService.count();
  }

  @GetMapping("insert")
  int insert(ExerciseData exerciseData) {
    return exerciseDataService.insert(exerciseData);
  }

  @GetMapping("update")
  int update(ExerciseData exerciseData) {
    return exerciseDataService.update(exerciseData);
  }

  @GetMapping("deleteById")
  int deleteById(Integer id) {
    return exerciseDataService.deleteById(id);
  }
}

